package md.mru.core.domains;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

@Entity
@Table(name = "order_types", schema = "c##mru_optimized")
public class OrderType implements Serializable {

    private static final long serialVersionUID = 2818437758924764820L;

    @Id
    private long id;
    @Column(name = "name", length = 150)
    private String name;
    @Column(name = "icon")
    private String icon;
    @Column(name = "change_to_folder_state_id")
    private Long changeToOrderTypeId;
    @Column(name = "notification")
    private String notification;
    @Column(name = "show_before_days")
    private Integer showBeforeDays;
    @Column(name = "repeat_notification")
    private String repeatNotification;
    /*@Lob
    @Column(name = "order_template")
    private String orderTemplate;*/
    @ManyToOne
    @JoinColumn(name = "order_type_group_id")
    private OrderTypeGroup orderTypeGroup;
    @ManyToOne
    @JoinColumn(name = "folder_state_id")
    private FolderState folderState;
    @OrderBy
    @OneToMany(mappedBy = "orderType")
    private List<OrderPattern> orderPatterns;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public Long getChangeToOrderTypeId() {
        return changeToOrderTypeId;
    }

    public void setChangeToOrderTypeId(Long changeToOrderTypeId) {
        this.changeToOrderTypeId = changeToOrderTypeId;
    }

    public String getNotification() {
        return notification;
    }

    public void setNotification(String notification) {
        this.notification = notification;
    }

    public Integer getShowBeforeDays() {
        return showBeforeDays;
    }

    public void setShowBeforeDays(Integer showBeforeDays) {
        this.showBeforeDays = showBeforeDays;
    }

    /*public String getOrderTemplate() {
        return orderTemplate;
    }

    public void setOrderTemplate(String orderTemplate) {
        this.orderTemplate = orderTemplate;
    }*/

    public String getRepeatNotification() {
        return repeatNotification;
    }

    public void setRepeatNotification(String repeatNotification) {
        this.repeatNotification = repeatNotification;
    }

    public OrderTypeGroup getOrderTypeGroup() {
        return orderTypeGroup;
    }

    public void setOrderTypeGroup(OrderTypeGroup orderTypeGroup) {
        this.orderTypeGroup = orderTypeGroup;
    }

    public FolderState getFolderState() {
        return folderState;
    }

    public void setFolderState(FolderState folderState) {
        this.folderState = folderState;
    }

    public List<OrderPattern> getOrderPatterns() {
        return orderPatterns;
    }

    public void setOrderPatterns(List<OrderPattern> orderPatterns) {
        this.orderPatterns = orderPatterns;
    }

}


